#ifndef __SpammerFactoryI_H__
#define __SpammerFactoryI_H__

#include <FIPA.h>
#include <SpammerI.h>

#include <Ice/Ice.h>
#include <IceUtil/UUID.h>
#include <IceUtil/Mutex.h>
#include <map>

using namespace std;

class SpammerFactoryI: public FIPA::AgentFactory
{
 public:
  SpammerFactoryI();
  ~SpammerFactoryI();

  virtual FIPA::AgentPrx create
    (const std::string&, 
     const Ice::Current&);
  virtual FIPA::AgentSeq createSeq
    (const Ice::StringSeq&, 
     Ice::StringSeq&,
     const ::Ice::Current&);

 private:
  IceUtil::Mutex _m;
  typedef std::map
    <Ice::Identity, SpammerIPtr>
    RMap;
  mutable RMap _agents;
};

typedef IceUtil::Handle<SpammerFactoryI> SpammerFactoryIPtr;

#endif
